package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallCustomerAddress;
import com.appkubes.mall.core.po.MallCustomerAddressExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallCustomerAddressMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerAddressSqlProvider.class, method="countByExample")
    long countByExample(MallCustomerAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallCustomerAddressSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallCustomerAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_customer_address",
        "where customer_address_key = #{customerAddressKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String customerAddressKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_customer_address (customer_address_key, app_key, ",
        "customer_key, `name`, ",
        "province, city, ",
        "district, address, ",
        "zip_code, contact_phone, ",
        "create_time, update_time, ",
        "version)",
        "values (#{customerAddressKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{customerKey,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
        "#{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, ",
        "#{district,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, ",
        "#{zipCode,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{version,jdbcType=INTEGER})"
    })
    int insert(MallCustomerAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallCustomerAddressSqlProvider.class, method="insertSelective")
    int insertSelective(MallCustomerAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerAddressSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="customer_address_key", property="customerAddressKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="zip_code", property="zipCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCustomerAddress> selectByExampleWithRowbounds(MallCustomerAddressExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallCustomerAddressSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="customer_address_key", property="customerAddressKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="zip_code", property="zipCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallCustomerAddress> selectByExample(MallCustomerAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "customer_address_key, app_key, customer_key, `name`, province, city, district, ",
        "address, zip_code, contact_phone, create_time, update_time, version",
        "from mall_customer_address",
        "where customer_address_key = #{customerAddressKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="customer_address_key", property="customerAddressKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="customer_key", property="customerKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="province", property="province", jdbcType=JdbcType.VARCHAR),
        @Result(column="city", property="city", jdbcType=JdbcType.VARCHAR),
        @Result(column="district", property="district", jdbcType=JdbcType.VARCHAR),
        @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR),
        @Result(column="zip_code", property="zipCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallCustomerAddress selectByPrimaryKey(String customerAddressKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerAddressSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallCustomerAddress record, @Param("example") MallCustomerAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerAddressSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallCustomerAddress record, @Param("example") MallCustomerAddressExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallCustomerAddressSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallCustomerAddress record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_customer_address
     *
     * @mbg.generated
     */
    @Update({
        "update mall_customer_address",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "customer_key = #{customerKey,jdbcType=VARCHAR},",
          "`name` = #{name,jdbcType=VARCHAR},",
          "province = #{province,jdbcType=VARCHAR},",
          "city = #{city,jdbcType=VARCHAR},",
          "district = #{district,jdbcType=VARCHAR},",
          "address = #{address,jdbcType=VARCHAR},",
          "zip_code = #{zipCode,jdbcType=VARCHAR},",
          "contact_phone = #{contactPhone,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "version = #{version,jdbcType=INTEGER}",
        "where customer_address_key = #{customerAddressKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallCustomerAddress record);
}